﻿using System;
using System.Collections.Generic;
using Character;
using H;
using UnityEngine;

// Token: 0x02000248 RID: 584
public class H_Voice : MonoBehaviour
{
	// Token: 0x06000F9B RID: 3995 RVA: 0x000640C4 File Offset: 0x000622C4
	public void Setup()
	{
		CustomDataListLoader customDataListLoader = new CustomDataListLoader();
		customDataListLoader.Load(this.voiceList);
		int attributeNo = customDataListLoader.GetAttributeNo("タイプ");
		int attributeNo2 = customDataListLoader.GetAttributeNo("状態");
		int attributeNo3 = customDataListLoader.GetAttributeNo("口の状態");
		int attributeNo4 = customDataListLoader.GetAttributeNo("速度");
		int attributeNo5 = customDataListLoader.GetAttributeNo("行為");
		int attributeNo6 = customDataListLoader.GetAttributeNo("詳細条件");
		int attributeNo7 = customDataListLoader.GetAttributeNo("優先度");
		int attributeNo8 = customDataListLoader.GetAttributeNo("種類");
		int attributeNo9 = customDataListLoader.GetAttributeNo("ファイル名");
		int attributeNo10 = customDataListLoader.GetAttributeNo("数");
		for (int i = 0; i < customDataListLoader.GetDataNum(); i++)
		{
			string data = customDataListLoader.GetData(attributeNo, i);
			string data2 = customDataListLoader.GetData(attributeNo2, i);
			string data3 = customDataListLoader.GetData(attributeNo3, i);
			string data4 = customDataListLoader.GetData(attributeNo4, i);
			string data5 = customDataListLoader.GetData(attributeNo5, i);
			string data6 = customDataListLoader.GetData(attributeNo6, i);
			string data7 = customDataListLoader.GetData(attributeNo7, i);
			string data8 = customDataListLoader.GetData(attributeNo8, i);
			string text = customDataListLoader.GetData(attributeNo9, i);
			string data9 = customDataListLoader.GetData(attributeNo10, i);
			int num = this.Number(data9);
			if (num > 1)
			{
				text = text.Remove(text.Length - 1);
				if (num > 10)
				{
					GlobalData.Debug_LogError("变奏的数量比预想的还要多:" + num + "個");
				}
				for (int j = 0; j < num; j++)
				{
					string fileStr = text + j.ToString();
					this.datas.Add(new H_Voice.Data(data, data2, data3, data4, data5, data6, data7, data8, fileStr));
				}
			}
			else
			{
				this.datas.Add(new H_Voice.Data(data, data2, data3, data4, data5, data6, data7, data8, text));
			}
		}
	}

	// Token: 0x06000F9C RID: 3996 RVA: 0x000642B4 File Offset: 0x000624B4
	private int Number(string check)
	{
		if (check == "-")
		{
			return -1;
		}
		int result = -1;
		try
		{
			result = int.Parse(check);
		}
		catch
		{
			GlobalData.Debug_LogError("数字変換失敗:" + check);
		}
		return result;
	}

	// Token: 0x06000F9D RID: 3997 RVA: 0x00064308 File Offset: 0x00062508
	public H_Voice.Data Voice(Female female, H_VoiceLog log, AssetBundleController voiceABC, H_Voice.TYPE type, H_Members members)
	{
		H_Voice.Data data = this.GetData(female, log, type, members);
		if (data != null)
		{
			string fileName = this.GetFileName(female.HeroineID, data);
			AudioClip audioClip = voiceABC.LoadAsset<AudioClip>(fileName);
			if (audioClip == null)
			{
				GlobalData.Debug_LogError("没有声音剪辑：" + fileName);
			}
			female.PhonationVoice(audioClip, false);
			if (female.personality.ahe)
			{
				female.ExpressionPlay(2, H_Voice.KindAnimes[3], 0.2f);
			}
			else
			{
				female.ExpressionPlay(2, H_Voice.KindAnimes[(int)data.kind], 0.2f);
			}
		}
		else
		{
			GlobalData.Debug_LogWarning("没有合适的声音:" + type.ToString());
		}
		return data;
	}

	// Token: 0x06000F9E RID: 3998 RVA: 0x000643C4 File Offset: 0x000625C4
	private H_Voice.Data GetData(Female female, H_VoiceLog log, H_Voice.TYPE type, H_Members members)
	{
		H_Voice.Data result = null;
		List<H_Voice.Data> list = new List<H_Voice.Data>();
		for (int i = 0; i < this.datas.Count; i++)
		{
			H_Voice.Data data = this.datas[i];
			if (data.Check(female, type, members))
			{
				list.Add(data);
			}
		}
		if (list.Count > 0)
		{
			log.Check(list);
			if (list.Count == 0)
			{
				return null;
			}
			this.CheckPriority(list);
			int index = UnityEngine.Random.Range(0, list.Count);
			result = list[index];
		}
		return result;
	}

	// Token: 0x06000F9F RID: 3999 RVA: 0x00064458 File Offset: 0x00062658
	private void CheckPriority(List<H_Voice.Data> datas)
	{
		int num = -1;
		for (int i = 0; i < datas.Count; i++)
		{
			if (datas[i].priority > num)
			{
				num = datas[i].priority;
			}
		}
		if (num == -1)
		{
			return;
		}
		for (int j = 0; j < datas.Count; j++)
		{
			if (datas[j].priority < num)
			{
				datas.RemoveAt(j);
				j--;
			}
		}
	}

	// Token: 0x06000FA0 RID: 4000 RVA: 0x000644DC File Offset: 0x000626DC
	private string GetFileName(HEROINE heroine, H_Voice.Data data)
	{
		if (data != null)
		{
			return H_Voice.HeroinePrefix[(int)heroine] + "_" + data.File;
		}
		return string.Empty;
	}

	// Token: 0x040010A6 RID: 4262
	private static readonly string[] TypeNames = new string[]
	{
		"呼吸",
		"開始",
		"放置",
		"挿入",
		"行為",
		"女イきそう",
		"男イきそう",
		"女絶頂",
		"男射精",
		"咳き込み",
		"飲み込み",
		"吐き出し",
		"口汁見せ",
		"汁垂れ",
		"漏らし",
		"事後台詞",
		"事後呼吸",
		"終了時評価",
		"行為質問",
		"体位変更"
	};

	// Token: 0x040010A7 RID: 4263
	private static readonly string[] StateNames = new string[]
	{
		"初回",
		"抵抗",
		"豹変",
		"脱力",
		"アヘ",
		"初回脱力",
		"抵抗脱力",
		"豹変脱力",
		"抵抗淫語",
		"豹変淫語",
		"豹変イベント",
		"姉妹最終イベント",
		"雪子最終イベント１",
		"雪子最終イベント２"
	};

	// Token: 0x040010A8 RID: 4264
	private static readonly string[] HeroinePrefix = new string[]
	{
		"r",
		"a",
		"y",
		"m"
	};

	// Token: 0x040010A9 RID: 4265
	private static readonly string[] KindNames = new string[]
	{
		"台詞",
		"呼吸",
		"喘ぎ",
		"アヘ"
	};

	// Token: 0x040010AA RID: 4266
	private static readonly string[] MouthNames = new string[]
	{
		"-",
		"キス",
		"舐め",
		"咥え",
		"猿轡"
	};

	// Token: 0x040010AB RID: 4267
	private static readonly string[] SpeedNames = new string[]
	{
		"遅",
		"普",
		"速"
	};

	// Token: 0x040010AC RID: 4268
	private static readonly string[] ActionNames = new string[]
	{
		"性器",
		"アナル",
		"挿入",
		"愛撫",
		"奉仕",
		"性器挿入",
		"アナル挿入",
		"手コキ",
		"パイズリ",
		"胸揉み",
		"オナニー",
		"性器オナニー",
		"アナルオナニー",
		"道具",
		"性器道具",
		"アナル道具"
	};

	// Token: 0x040010AD RID: 4269
	private static readonly string[] DetailNames = new string[]
	{
		"男主導",
		"女主導",
		"フェラ",
		"イラマ",
		"アタリ",
		"苦痛",
		"多射精",
		"性器処女",
		"アナル処女",
		"女絶頂",
		"男射精",
		"中出し",
		"外出し",
		"咳き込み",
		"飲み込み",
		"吐き出し",
		"口内汁見せ",
		"膣感",
		"肛感",
		"精好",
		"口淫",
		"複数が相手",
		"広一が相手",
		"女アタリ",
		"女ハズレ",
		"男アタリ",
		"男ハズレ",
		"何度も絶頂した",
		"何度も性器絶頂した",
		"何度もアナルで絶頂した",
		"1度だけ絶頂した",
		"何度も射精した",
		"何度も性器に射精した",
		"何度もアナルに射精した",
		"1度だけ射精した",
		"広一とした",
		"何もせず終了",
		"元傍観者",
		"傍観者がいる",
		"自室マップ",
		"庭マップ",
		"トイレマップ",
		"狭所マップ",
		"膣挿入してほしい",
		"アナル挿入してほしい",
		"挿入してほしい体位",
		"挿入するんでしょ？",
		"好きな行為",
		"傍観者接近"
	};

	// Token: 0x040010AE RID: 4270
	private static readonly string[] KindAnimes = new string[]
	{
		"FemaleLipSync_Def",
		"FemaleLipSync_Breath",
		"FemaleLipSync_Pant",
		"FemaleLipSync_Ahe"
	};

	// Token: 0x040010AF RID: 4271
	private const float NEAR_VISITOR = 1.2f;

	// Token: 0x040010B0 RID: 4272
	[SerializeField]
	private TextAsset voiceList;

	// Token: 0x040010B1 RID: 4273
	private List<H_Voice.Data> datas = new List<H_Voice.Data>();

	// Token: 0x02000249 RID: 585
	public enum TYPE
	{
		// Token: 0x040010B3 RID: 4275
		BREATH,
		// Token: 0x040010B4 RID: 4276
		START,
		// Token: 0x040010B5 RID: 4277
		LEAVING,
		// Token: 0x040010B6 RID: 4278
		INSERT,
		// Token: 0x040010B7 RID: 4279
		ACT,
		// Token: 0x040010B8 RID: 4280
		XTC_OMEN_F,
		// Token: 0x040010B9 RID: 4281
		XTC_OMEN_M,
		// Token: 0x040010BA RID: 4282
		XTC_F,
		// Token: 0x040010BB RID: 4283
		XTC_M,
		// Token: 0x040010BC RID: 4284
		COUGH,
		// Token: 0x040010BD RID: 4285
		DRINK,
		// Token: 0x040010BE RID: 4286
		VOMIT,
		// Token: 0x040010BF RID: 4287
		SHOW_ORAL,
		// Token: 0x040010C0 RID: 4288
		FALL_LIQUID,
		// Token: 0x040010C1 RID: 4289
		INCONTINENCE,
		// Token: 0x040010C2 RID: 4290
		XTC_AFTER_TALK,
		// Token: 0x040010C3 RID: 4291
		XTC_AFTER_BREATH,
		// Token: 0x040010C4 RID: 4292
		EXIT,
		// Token: 0x040010C5 RID: 4293
		ACT_TALK,
		// Token: 0x040010C6 RID: 4294
		CHANGE_STYLE,
		// Token: 0x040010C7 RID: 4295
		NUM
	}

	// Token: 0x0200024A RID: 586
	public enum STATE
	{
		// Token: 0x040010C9 RID: 4297
		ANY,
		// Token: 0x040010CA RID: 4298
		FIRST,
		// Token: 0x040010CB RID: 4299
		RESIST,
		// Token: 0x040010CC RID: 4300
		FLOP = 4,
		// Token: 0x040010CD RID: 4301
		WEAKNESS = 8,
		// Token: 0x040010CE RID: 4302
		AHE = 16,
		// Token: 0x040010CF RID: 4303
		FIRST_WEAKNESS = 32,
		// Token: 0x040010D0 RID: 4304
		RESIST_WEAKNESS = 64,
		// Token: 0x040010D1 RID: 4305
		FLOP_WEAKNESS = 128,
		// Token: 0x040010D2 RID: 4306
		RESIST_INDECENT = 256,
		// Token: 0x040010D3 RID: 4307
		FLOP_INDECENT = 512,
		// Token: 0x040010D4 RID: 4308
		FLIP_FLOP = 1024,
		// Token: 0x040010D5 RID: 4309
		LAST_EVENT_SISTERS = 2048,
		// Token: 0x040010D6 RID: 4310
		LAST_EVENT_YUKIKO_1 = 4096,
		// Token: 0x040010D7 RID: 4311
		LAST_EVENT_YUKIKO_2 = 8192,
		// Token: 0x040010D8 RID: 4312
		NUM = 14
	}

	// Token: 0x0200024B RID: 587
	public enum KIND
	{
		// Token: 0x040010DA RID: 4314
		TALK,
		// Token: 0x040010DB RID: 4315
		BREATH,
		// Token: 0x040010DC RID: 4316
		PANT,
		// Token: 0x040010DD RID: 4317
		AHE,
		// Token: 0x040010DE RID: 4318
		NUM
	}

	// Token: 0x0200024C RID: 588
	public enum ACTION
	{
		// Token: 0x040010E0 RID: 4320
		ANY,
		// Token: 0x040010E1 RID: 4321
		VAGINA,
		// Token: 0x040010E2 RID: 4322
		ANAL,
		// Token: 0x040010E3 RID: 4323
		INSERT = 4,
		// Token: 0x040010E4 RID: 4324
		PETTING = 8,
		// Token: 0x040010E5 RID: 4325
		SERVICE = 16,
		// Token: 0x040010E6 RID: 4326
		VAGINA_INSERT = 32,
		// Token: 0x040010E7 RID: 4327
		ANAL_INSERT = 64,
		// Token: 0x040010E8 RID: 4328
		HAND_JOB = 128,
		// Token: 0x040010E9 RID: 4329
		TITTY_FUCK = 256,
		// Token: 0x040010EA RID: 4330
		PET_BUST = 512,
		// Token: 0x040010EB RID: 4331
		ONANIE = 1024,
		// Token: 0x040010EC RID: 4332
		VAGINA_ONANIE = 2048,
		// Token: 0x040010ED RID: 4333
		ANAL_ONANIE = 4096,
		// Token: 0x040010EE RID: 4334
		TOOL = 8192,
		// Token: 0x040010EF RID: 4335
		VAGINA_TOOL = 16384,
		// Token: 0x040010F0 RID: 4336
		ANAL_TOOL = 32768,
		// Token: 0x040010F1 RID: 4337
		NUM = 16
	}

	// Token: 0x0200024D RID: 589
	public enum DETAIL : long
	{
		// Token: 0x040010F3 RID: 4339
		INITIATIVE_MALE,
		// Token: 0x040010F4 RID: 4340
		INITIATIVE_FEMALE,
		// Token: 0x040010F5 RID: 4341
		FELLATIO,
		// Token: 0x040010F6 RID: 4342
		IRRUMATIO,
		// Token: 0x040010F7 RID: 4343
		HIT,
		// Token: 0x040010F8 RID: 4344
		PAIN,
		// Token: 0x040010F9 RID: 4345
		MANY_EJACULATION,
		// Token: 0x040010FA RID: 4346
		VAGINA_VIRGIN,
		// Token: 0x040010FB RID: 4347
		ANAL_VIRGIN,
		// Token: 0x040010FC RID: 4348
		XTC_FEMALE,
		// Token: 0x040010FD RID: 4349
		EJACULATION_MALE,
		// Token: 0x040010FE RID: 4350
		EJACULATION_IN,
		// Token: 0x040010FF RID: 4351
		EJACULATION_OUT,
		// Token: 0x04001100 RID: 4352
		COUGH,
		// Token: 0x04001101 RID: 4353
		DRINK,
		// Token: 0x04001102 RID: 4354
		VOMIT,
		// Token: 0x04001103 RID: 4355
		SHOW_ORAL,
		// Token: 0x04001104 RID: 4356
		BADGE_FEEL_VAGINA,
		// Token: 0x04001105 RID: 4357
		BADGE_FEEL_ANUS,
		// Token: 0x04001106 RID: 4358
		BADGE_LIKE_SPERM,
		// Token: 0x04001107 RID: 4359
		BADGE_LIKE_FERATIO,
		// Token: 0x04001108 RID: 4360
		TO_MULTI,
		// Token: 0x04001109 RID: 4361
		TO_KOUICHI,
		// Token: 0x0400110A RID: 4362
		FEMALE_HIT,
		// Token: 0x0400110B RID: 4363
		FEMALE_NOHIT,
		// Token: 0x0400110C RID: 4364
		MALE_HIT,
		// Token: 0x0400110D RID: 4365
		MALE_NOHIT,
		// Token: 0x0400110E RID: 4366
		ENDCHECK_MANY_XTC,
		// Token: 0x0400110F RID: 4367
		ENDCHECK_MANY_XTC_VAGINA,
		// Token: 0x04001110 RID: 4368
		ENDCHECK_MANY_XTC_ANUS,
		// Token: 0x04001111 RID: 4369
		ENDCHECK_ONE_XTC,
		// Token: 0x04001112 RID: 4370
		ENDCHECK_MANY_EJA,
		// Token: 0x04001113 RID: 4371
		ENDCHECK_MANY_EJA_VAGINA,
		// Token: 0x04001114 RID: 4372
		ENDCHECK_MANY_EJA_ANUS,
		// Token: 0x04001115 RID: 4373
		ENDCHECK_ONE_EJA,
		// Token: 0x04001116 RID: 4374
		ENDCHECK_TO_KOUICHI,
		// Token: 0x04001117 RID: 4375
		ENDCHECK_NO_ACTION,
		// Token: 0x04001118 RID: 4376
		FORMER_ONLOOKER,
		// Token: 0x04001119 RID: 4377
		THERE_IS_ONLOOKER,
		// Token: 0x0400111A RID: 4378
		MAP_MYROOM,
		// Token: 0x0400111B RID: 4379
		MAP_GARDEN,
		// Token: 0x0400111C RID: 4380
		MAP_TOILET,
		// Token: 0x0400111D RID: 4381
		MAP_NARROW,
		// Token: 0x0400111E RID: 4382
		WANT_INSERT_VAGINA,
		// Token: 0x0400111F RID: 4383
		WANT_INSERT_ANUS,
		// Token: 0x04001120 RID: 4384
		WANT_INSERT_STYLE,
		// Token: 0x04001121 RID: 4385
		YOU_INSERT_ME,
		// Token: 0x04001122 RID: 4386
		LIKE_ACTION,
		// Token: 0x04001123 RID: 4387
		APPROACH_ONLOOKER,
		// Token: 0x04001124 RID: 4388
		NUM
	}

	// Token: 0x0200024E RID: 590
	public class Data
	{
		// Token: 0x06000FA2 RID: 4002 RVA: 0x00064970 File Offset: 0x00062B70
		public Data(string typeStr, string stateStr, string mouthStr, string speedStr, string actionStr, string detailStr, string priorityStr, string kindStr, string fileStr)
		{
			this.type = (H_Voice.TYPE)H_Voice.Data.StringsCheck(H_Voice.TypeNames, typeStr);
			this.state = H_Voice.Data.SetupState(stateStr);
			this.mouth = H_Voice.Data.SetupMouth(mouthStr);
			this.speed = H_Voice.Data.SetupSpeed(speedStr);
			this.action = H_Voice.Data.SetupAction(actionStr);
			this.details = new bool[49];
			H_Voice.Data.SetupDetail(this.details, detailStr);
			if (priorityStr == "-")
			{
				this.priority = -1;
			}
			else
			{
				this.priority = int.Parse(priorityStr);
			}
			this.kind = (H_Voice.KIND)H_Voice.Data.StringsCheck(H_Voice.KindNames, kindStr);
			this.File = fileStr;
		}

		// Token: 0x1700018A RID: 394
		// (get) Token: 0x06000FA3 RID: 4003 RVA: 0x00064A24 File Offset: 0x00062C24
		// (set) Token: 0x06000FA4 RID: 4004 RVA: 0x00064A2C File Offset: 0x00062C2C
		public H_Voice.TYPE type { get; private set; }

		// Token: 0x1700018B RID: 395
		// (get) Token: 0x06000FA5 RID: 4005 RVA: 0x00064A38 File Offset: 0x00062C38
		// (set) Token: 0x06000FA6 RID: 4006 RVA: 0x00064A40 File Offset: 0x00062C40
		public H_Voice.KIND kind { get; private set; }

		// Token: 0x1700018C RID: 396
		// (get) Token: 0x06000FA7 RID: 4007 RVA: 0x00064A4C File Offset: 0x00062C4C
		// (set) Token: 0x06000FA8 RID: 4008 RVA: 0x00064A54 File Offset: 0x00062C54
		public H_Voice.STATE state { get; private set; }

		// Token: 0x1700018D RID: 397
		// (get) Token: 0x06000FA9 RID: 4009 RVA: 0x00064A60 File Offset: 0x00062C60
		// (set) Token: 0x06000FAA RID: 4010 RVA: 0x00064A68 File Offset: 0x00062C68
		public H_MOUTH mouth { get; private set; }

		// Token: 0x1700018E RID: 398
		// (get) Token: 0x06000FAB RID: 4011 RVA: 0x00064A74 File Offset: 0x00062C74
		// (set) Token: 0x06000FAC RID: 4012 RVA: 0x00064A7C File Offset: 0x00062C7C
		public H_SPEED speed { get; private set; }

		// Token: 0x1700018F RID: 399
		// (get) Token: 0x06000FAD RID: 4013 RVA: 0x00064A88 File Offset: 0x00062C88
		// (set) Token: 0x06000FAE RID: 4014 RVA: 0x00064A90 File Offset: 0x00062C90
		public H_Voice.ACTION action { get; private set; }

		// Token: 0x17000190 RID: 400
		// (get) Token: 0x06000FAF RID: 4015 RVA: 0x00064A9C File Offset: 0x00062C9C
		// (set) Token: 0x06000FB0 RID: 4016 RVA: 0x00064AA4 File Offset: 0x00062CA4
		public bool[] details { get; private set; }

		// Token: 0x17000191 RID: 401
		// (get) Token: 0x06000FB1 RID: 4017 RVA: 0x00064AB0 File Offset: 0x00062CB0
		// (set) Token: 0x06000FB2 RID: 4018 RVA: 0x00064AB8 File Offset: 0x00062CB8
		public int priority { get; private set; }

		// Token: 0x17000192 RID: 402
		// (get) Token: 0x06000FB3 RID: 4019 RVA: 0x00064AC4 File Offset: 0x00062CC4
		// (set) Token: 0x06000FB4 RID: 4020 RVA: 0x00064ACC File Offset: 0x00062CCC
		public string File { get; private set; }

		// Token: 0x06000FB5 RID: 4021 RVA: 0x00064AD8 File Offset: 0x00062CD8
		private static int StringsCheck(string[] strings, string check)
		{
			for (int i = 0; i < strings.Length; i++)
			{
				if (check == strings[i])
				{
					return i;
				}
			}
			return -1;
		}

		// Token: 0x06000FB6 RID: 4022 RVA: 0x00064B0C File Offset: 0x00062D0C
		private static void SetupDetail(bool[] details, string str)
		{
			for (int i = 0; i < details.Length; i++)
			{
				details[i] = false;
			}
			string[] array = str.Split(new char[]
			{
				'+'
			}, StringSplitOptions.RemoveEmptyEntries);
			for (int j = 0; j < array.Length; j++)
			{
				if (!(array[j] == "-"))
				{
					int k;
					for (k = 0; k < H_Voice.DetailNames.Length; k++)
					{
						if (array[j] == H_Voice.DetailNames[k])
						{
							details[k] |= true;
							break;
						}
					}
					if (k == H_Voice.DetailNames.Length)
					{
						GlobalData.Debug_LogError("不明的详细条件：" + array[j]);
					}
				}
			}
		}

		// Token: 0x06000FB7 RID: 4023 RVA: 0x00064BD0 File Offset: 0x00062DD0
		private static H_MOUTH SetupMouth(string str)
		{
			H_MOUTH h_MOUTH = H_MOUTH.FREE;
			string[] array = str.Split(new char[]
			{
				','
			});
			int[] array2 = new int[]
			{
				0,
				1,
				2,
				4,
				8
			};
			for (int i = 0; i < array.Length; i++)
			{
				int num = H_Voice.Data.StringsCheck(H_Voice.MouthNames, array[i]);
				h_MOUTH |= (H_MOUTH)array2[num];
			}
			return h_MOUTH;
		}

		// Token: 0x06000FB8 RID: 4024 RVA: 0x00064C30 File Offset: 0x00062E30
		private static H_Voice.STATE SetupState(string str)
		{
			if (str == "-")
			{
				return H_Voice.STATE.ANY;
			}
			string[] array = str.Split(new char[]
			{
				','
			}, StringSplitOptions.RemoveEmptyEntries);
			H_Voice.STATE state = H_Voice.STATE.ANY;
			for (int i = 0; i < array.Length; i++)
			{
				int j;
				for (j = 0; j < H_Voice.StateNames.Length; j++)
				{
					if (array[i] == H_Voice.StateNames[j])
					{
						state |= (H_Voice.STATE)(1 << j);
						break;
					}
				}
				if (j == H_Voice.StateNames.Length)
				{
					GlobalData.Debug_LogError("不明确的速度：" + array[i]);
				}
			}
			return state;
		}

		// Token: 0x06000FB9 RID: 4025 RVA: 0x00064CD4 File Offset: 0x00062ED4
		private static H_SPEED SetupSpeed(string str)
		{
			if (str == "-")
			{
				return H_SPEED.ALL;
			}
			string[] array = str.Split(new char[]
			{
				','
			}, StringSplitOptions.RemoveEmptyEntries);
			H_SPEED h_SPEED = (H_SPEED)0;
			for (int i = 0; i < array.Length; i++)
			{
				int j;
				for (j = 0; j < H_Voice.SpeedNames.Length; j++)
				{
					if (array[i] == H_Voice.SpeedNames[j])
					{
						h_SPEED |= (H_SPEED)(1 << j);
						break;
					}
				}
				if (j == H_Voice.SpeedNames.Length)
				{
					GlobalData.Debug_LogError("不明确的速度：" + array[i]);
				}
			}
			return h_SPEED;
		}

		// Token: 0x06000FBA RID: 4026 RVA: 0x00064D78 File Offset: 0x00062F78
		private static H_Voice.ACTION SetupAction(string str)
		{
			if (str == "-")
			{
				return H_Voice.ACTION.ANY;
			}
			string[] array = str.Split(new char[]
			{
				','
			}, StringSplitOptions.RemoveEmptyEntries);
			H_Voice.ACTION action = H_Voice.ACTION.ANY;
			for (int i = 0; i < array.Length; i++)
			{
				int j;
				for (j = 0; j < H_Voice.ActionNames.Length; j++)
				{
					if (array[i] == H_Voice.ActionNames[j])
					{
						action |= (H_Voice.ACTION)(1 << j);
						break;
					}
				}
				if (j == H_Voice.ActionNames.Length)
				{
					GlobalData.Debug_LogError("不明确的行为：" + array[i]);
				}
			}
			return action;
		}

		// Token: 0x06000FBB RID: 4027 RVA: 0x00064E1C File Offset: 0x0006301C
		public bool Check(Female female, H_Voice.TYPE type, H_Members members)
		{
			return this.type == type && this.CheckMouth(female, members.param) && this.CheckState(female, members.param) && this.CheckSpeed(members.param) && this.CheckAction(members.param) && this.CheckDetail(female, members);
		}

		// Token: 0x06000FBC RID: 4028 RVA: 0x00064E98 File Offset: 0x00063098
		private bool CheckMouth(Female female, H_Parameter param)
		{
			H_MOUTH h_MOUTH = (param.style == null || param.style.type == H_StyleData.TYPE.PETTING) ? H_MOUTH.FREE : param.mouth;
			if (female.Gag)
			{
				h_MOUTH = H_MOUTH.MASK;
			}
			if (this.mouth == H_MOUTH.FREE)
			{
				return h_MOUTH == H_MOUTH.FREE;
			}
			bool flag = false;
			if ((this.mouth & H_MOUTH.MASK) != H_MOUTH.FREE)
			{
				flag |= female.Gag;
			}
			return flag | (this.mouth & h_MOUTH) != H_MOUTH.FREE;
		}

		// Token: 0x06000FBD RID: 4029 RVA: 0x00064F18 File Offset: 0x00063118
		private bool CheckSpeed(H_Parameter param)
		{
			return (this.speed & param.speed) != (H_SPEED)0;
		}

		// Token: 0x06000FBE RID: 4030 RVA: 0x00064F30 File Offset: 0x00063130
		private bool CheckState(Female female, H_Parameter param)
		{
			return this.state == H_Voice.STATE.ANY || ((this.state & H_Voice.STATE.FIRST) != H_Voice.STATE.ANY && female.personality.state == Personality.STATE.FIRST) || ((this.state & H_Voice.STATE.RESIST) != H_Voice.STATE.ANY && female.personality.state != Personality.STATE.FIRST && !female.IsFloped()) || ((this.state & H_Voice.STATE.FLOP) != H_Voice.STATE.ANY && female.IsFloped() && !female.personality.ahe) || ((this.state & H_Voice.STATE.WEAKNESS) != H_Voice.STATE.ANY && female.personality.weakness) || ((this.state & H_Voice.STATE.AHE) != H_Voice.STATE.ANY && female.personality.ahe) || ((this.state & H_Voice.STATE.FIRST_WEAKNESS) != H_Voice.STATE.ANY && female.personality.state == Personality.STATE.FIRST && female.personality.weakness) || ((this.state & H_Voice.STATE.RESIST_WEAKNESS) != H_Voice.STATE.ANY && female.personality.state != Personality.STATE.FIRST && !female.IsFloped() && female.personality.weakness) || ((this.state & H_Voice.STATE.FLOP_WEAKNESS) != H_Voice.STATE.ANY && female.IsFloped() && female.personality.weakness) || ((this.state & H_Voice.STATE.RESIST_INDECENT) != H_Voice.STATE.ANY && !female.IsFloped() && female.personality.indecentLanguage) || ((this.state & H_Voice.STATE.FLOP_INDECENT) != H_Voice.STATE.ANY && female.IsFloped() && female.personality.indecentLanguage && !female.personality.ahe) || ((this.state & H_Voice.STATE.FLIP_FLOP) != H_Voice.STATE.ANY && female.personality.state == Personality.STATE.FLIP_FLOP) || ((this.state & H_Voice.STATE.LAST_EVENT_SISTERS) != H_Voice.STATE.ANY && female.personality.state == Personality.STATE.LAST_EVENT_SISTERS) || ((this.state & H_Voice.STATE.LAST_EVENT_YUKIKO_1) != H_Voice.STATE.ANY && female.personality.state == Personality.STATE.LAST_EVENT_YUKIKO_1) || ((this.state & H_Voice.STATE.LAST_EVENT_YUKIKO_2) != H_Voice.STATE.ANY && female.personality.state == Personality.STATE.LAST_EVENT_YUKIKO_2);
		}

		// Token: 0x06000FBF RID: 4031 RVA: 0x00065194 File Offset: 0x00063394
		private bool CheckAction(H_Parameter param)
		{
			return this.action == H_Voice.ACTION.ANY || ((this.action & H_Voice.ACTION.VAGINA) != H_Voice.ACTION.ANY && (param.style.detailFlag & 16) != 0) || ((this.action & H_Voice.ACTION.ANAL) != H_Voice.ACTION.ANY && (param.style.detailFlag & 32) != 0) || ((this.action & H_Voice.ACTION.INSERT) != H_Voice.ACTION.ANY && param.style.type == H_StyleData.TYPE.INSERT) || ((this.action & H_Voice.ACTION.PETTING) != H_Voice.ACTION.ANY && param.style.type == H_StyleData.TYPE.PETTING) || ((this.action & H_Voice.ACTION.SERVICE) != H_Voice.ACTION.ANY && param.style.type == H_StyleData.TYPE.SERVICE) || ((this.action & H_Voice.ACTION.VAGINA_INSERT) != H_Voice.ACTION.ANY && param.style.type == H_StyleData.TYPE.INSERT && (param.style.detailFlag & 16) != 0) || ((this.action & H_Voice.ACTION.ANAL_INSERT) != H_Voice.ACTION.ANY && param.style.type == H_StyleData.TYPE.INSERT && (param.style.detailFlag & 32) != 0) || ((this.action & H_Voice.ACTION.HAND_JOB) != H_Voice.ACTION.ANY && param.style.type == H_StyleData.TYPE.SERVICE && (param.style.detailFlag & 64) != 0) || ((this.action & H_Voice.ACTION.TITTY_FUCK) != H_Voice.ACTION.ANY && param.style.type == H_StyleData.TYPE.SERVICE && (param.style.detailFlag & 128) != 0) || ((this.action & H_Voice.ACTION.PET_BUST) != H_Voice.ACTION.ANY && param.style.type == H_StyleData.TYPE.PETTING && (param.style.detailFlag & 256) != 0) || ((this.action & H_Voice.ACTION.ONANIE) != H_Voice.ACTION.ANY && (param.style.detailFlag & 512) != 0) || ((this.action & H_Voice.ACTION.VAGINA_ONANIE) != H_Voice.ACTION.ANY && (param.style.detailFlag & 512) != 0 && (param.style.detailFlag & 16) != 0) || ((this.action & H_Voice.ACTION.ANAL_ONANIE) != H_Voice.ACTION.ANY && (param.style.detailFlag & 512) != 0 && (param.style.detailFlag & 32) != 0) || ((this.action & H_Voice.ACTION.TOOL) != H_Voice.ACTION.ANY && (param.style.detailFlag & 1024) != 0) || ((this.action & H_Voice.ACTION.VAGINA_TOOL) != H_Voice.ACTION.ANY && (param.style.detailFlag & 1024) != 0 && (param.style.detailFlag & 16) != 0) || ((this.action & H_Voice.ACTION.ANAL_TOOL) != H_Voice.ACTION.ANY && (param.style.detailFlag & 1024) != 0 && (param.style.detailFlag & 32) != 0);
		}

		// Token: 0x06000FC0 RID: 4032 RVA: 0x000654A8 File Offset: 0x000636A8
		private bool CheckDetail(Female female, H_Members members)
		{
			bool[] array = new bool[49];
			H_Voice.Data.CheckDetail(female, members, array);
			for (int i = 0; i < this.details.Length; i++)
			{
				if (this.details[i] && !array[i])
				{
					return false;
				}
			}
			return true;
		}

		// Token: 0x06000FC1 RID: 4033 RVA: 0x000654F8 File Offset: 0x000636F8
		public static void CheckDetail(Female female, H_Members members, bool[] checkList)
		{
			H_Parameter param = members.param;
			H_StyleData style = param.style;
			List<Male> males = members.GetMales();
			checkList[0] = (style != null && style.initiative == H_StyleData.INITIATIVE.MALE);
			checkList[1] = (style != null && style.initiative == H_StyleData.INITIATIVE.FEMALE);
			checkList[2] = (style != null && (style.detailFlag & 4) != 0);
			checkList[3] = (style != null && (style.detailFlag & 8) != 0);
			checkList[4] = (param.hitEnableStyle && param.hit);
			checkList[5] = false;
			if (style != null && style.type == H_StyleData.TYPE.INSERT)
			{
				if ((style.detailFlag & 16) != 0 && female.personality.vaginaVirgin)
				{
					checkList[5] = true;
				}
				else if ((style.detailFlag & 32) != 0 && female.personality.analVirgin)
				{
					checkList[5] = true;
				}
			}
			checkList[6] = param.manyEjaculation;
			checkList[7] = female.personality.vaginaVirgin;
			checkList[8] = female.personality.analVirgin;
			checkList[9] = (param.xtcType == XTC_TYPE.XTC_W || param.xtcType == XTC_TYPE.XTC_F);
			checkList[10] = (param.xtcType != XTC_TYPE.XTC_F);
			checkList[11] = (param.xtcType == XTC_TYPE.EJA_IN);
			checkList[12] = (param.xtcType == XTC_TYPE.EJA_OUT);
			checkList[13] = ((param.detail & H_Parameter.DETAIL.COUGH) != H_Parameter.DETAIL.NO);
			checkList[14] = ((param.detail & H_Parameter.DETAIL.DRINK) != H_Parameter.DETAIL.NO);
			checkList[15] = ((param.detail & H_Parameter.DETAIL.VOMIT) != H_Parameter.DETAIL.NO);
			checkList[16] = ((param.detail & H_Parameter.DETAIL.SHOW_ORAL) != H_Parameter.DETAIL.NO);
			checkList[17] = female.personality.feelVagina;
			checkList[18] = female.personality.feelAnus;
			checkList[19] = female.personality.likeSperm;
			checkList[20] = female.personality.likeFeratio;
			checkList[21] = (style != null && (style.member == H_StyleData.MEMBER.M2F1 || style.member == H_StyleData.MEMBER.M3F1 || style.member == H_StyleData.MEMBER.M4F1));
			checkList[22] = false;
			for (int i = 0; i < members.GetMales().Count; i++)
			{
				Male male = members.GetMale(i);
				if (male.MaleID == MALE_ID.KOUICHI)
				{
					checkList[22] = true;
					break;
				}
			}
			checkList[23] = (style != null && param.hitEnableStyle && style.type != H_StyleData.TYPE.SERVICE && param.hit);
			checkList[24] = (style != null && param.hitEnableStyle && style.type != H_StyleData.TYPE.SERVICE && !param.hit);
			checkList[25] = (style != null && style.type == H_StyleData.TYPE.SERVICE && param.hit);
			checkList[26] = (style != null && style.type == H_StyleData.TYPE.SERVICE && !param.hit);
			checkList[27] = (female.personality.xtc_count_vagina + female.personality.xtc_count_anal >= 5);
			checkList[28] = (female.personality.xtc_count_vagina >= 5);
			checkList[29] = (female.personality.xtc_count_anal >= 5);
			checkList[30] = (female.personality.xtc_count_vagina + female.personality.xtc_count_anal == 1);
			checkList[31] = (female.personality.eja_count >= 5);
			checkList[32] = (female.personality.eja_count_vagina >= 5);
			checkList[33] = (female.personality.eja_count_anal >= 5);
			checkList[34] = (female.personality.eja_count_vagina + female.personality.eja_count_vagina == 1);
			checkList[35] = false;
			for (int j = 0; j < males.Count; j++)
			{
				if (males[j].MaleID == MALE_ID.KOUICHI)
				{
					checkList[35] = true;
					break;
				}
			}
			checkList[36] = !param.anyAction;
			checkList[37] = (param.swapVisitor == 1);
			checkList[38] = (members.h_scene.visitor != null);
			checkList[39] = false;
			if (female.HeroineID == HEROINE.RITSUKO && param.mapName.IndexOf("ritsuko") != -1)
			{
				checkList[39] = true;
			}
			else if (female.HeroineID == HEROINE.AKIKO && param.mapName.IndexOf("akiko") != -1)
			{
				checkList[39] = true;
			}
			else if (female.HeroineID == HEROINE.YUKIKO && param.mapName.IndexOf("bedroom") != -1)
			{
				checkList[39] = true;
			}
			checkList[40] = (param.mapName.IndexOf("yard") != -1);
			checkList[41] = (param.mapName.IndexOf("toilet") != -1);
			checkList[42] = (param.mapName.IndexOf("japanese") != -1 && style != null && style.map.Length > 0);
			checkList[43] = (female.personality.feelVagina && female.personality.continuousInsVagina <= -3);
			checkList[44] = (female.personality.feelAnus && female.personality.continuousInsAnal <= -3);
			checkList[45] = ((female.personality.feelVagina && female.personality.continuousInsVagina <= -3) || (female.personality.feelAnus && female.personality.continuousInsAnal <= -3));
			checkList[46] = ((female.personality.feelVagina && female.personality.continuousInsVagina >= 3) || (female.personality.feelAnus && female.personality.continuousInsAnal >= 3));
			checkList[47] = false;
			if (style != null)
			{
				if (female.personality.feelVagina && (style.detailFlag & 16) != 0)
				{
					checkList[47] = true;
				}
				if (female.personality.feelAnus && (style.detailFlag & 32) != 0)
				{
					checkList[47] = true;
				}
				if (female.personality.likeFeratio && (style.detailFlag & H_StyleData.DetailMasking_InMouth) != 0)
				{
					checkList[47] = true;
				}
			}
			checkList[48] = false;
			float num = float.MaxValue;
			if (members.h_scene.visitor != null)
			{
				Vector3 position = members.h_scene.visitor.GetHuman().transform.position;
				num = Vector3.Distance(position, members.Transform.position);
			}
			checkList[48] = (num <= 1.2f);
		}
	}
}
